package com.youpingou.controller;

import com.youpingou.domain.Specification;
import com.youpingou.service.SpecificationService;
import com.youpingou.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @auther Created by yuanxinqi 
 */
@RestController
@RequestMapping
public class SpecificationController {

    @Autowired
    private SpecificationService specificationService;

   @GetMapping("/specifications/{cat3id}")
    public BaseResult findSpecByCat3id(@PathVariable("cat3id") Integer cat3id){
        //直接调用service
        List<Specification> list = specificationService.findSpecificationByCat3id(cat3id);
        // 封装结果
        return BaseResult.ok(list);
    }



}